#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include "game/sudoku/sudokuthread.h"

class LoginWidget;
class MainWidget;
class GameView;
class gamescene;
class QProgressIndicator;
class EndWidget;
class HelpWidget;
class StatisticsWidget;
class AboutWidget;
class SettingWidget;

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    enum ScreenOrientation {
        ScreenOrientationLockPortrait,
        ScreenOrientationLockLandscape,
        ScreenOrientationAuto
    };

    explicit MainWindow(QWidget *parent = 0);
    virtual ~MainWindow();
    virtual bool event(QEvent *event);

    // Note that this will only have an effect on Symbian and Fremantle.
    void setOrientation(ScreenOrientation orientation);

    void init();
    void GameWin();
    void UnlockBtn(int l = 0);
    void setMainConnect();

    LoginWidget         *m_loginwidget;
    MainWidget          *m_mainwidget;
    GameView            *m_gameview;
    gamescene           *m_gamescene;
    QProgressIndicator  *m_pi;
    SudokuThread         m_sudokuThread;
    EndWidget           *m_endwidget;
    HelpWidget          *m_helpWidget;
    StatisticsWidget    *m_statisWidget;
    AboutWidget         *m_aboutWidget;
    SettingWidget       *m_setWidget;

public slots:
    void starttomain();
    void playgame();
    void gameback();
    void SudokuCreat();
    void HideHelpWedget();
    void ShowHelpWidget();
    void statisTomain();
    void maintoStatis();
    void aboutToMain();
    void MainToAbout();
    void MainToSet();
    void SetToMain();
    void ContinueGame();
    void EndToMain();
    void ContinuePlay();
};

#endif // MAINWINDOW_H
